CXXFLAG = -O2
HEADERS = include/BasicTypes.h \
	include/Config.h \
	include/DateTime.h \
	include/FastDelegate.h \
	include/FastEvent.h \
	include/FileSystemUtil.h \
	include/HttpUtil.h \
	include/Locks.h \
	include/Socket.h \
	include/SockStream.h \
	include/StringUtil.h \
	include/ThreadUtil.h \
	include/TimeBasedDatabase.h \
	include/Url.h
SOURCES = src/FileSystemUtil.cpp \
	src/HttpUtil.cpp \
	src/Socket.cpp \
	src/StringUtil.cpp \
	src/TimeBasedDatabase.cpp \
	src/Url.cpp 
OBJECTS = FileSystemUtil.o \
	HttpUtil.o \
	Socket.o \
	StringUtil.o \
	Url.o \
	TimeBasedDatabase.o
INCDIR = -Iinclude
all: Makefile $(OBJECTS) libutil.a

FileSystemUtil.o: src/FileSystemUtil.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCDIR) src/FileSystemUtil.cpp
HttpUtil.o: src/HttpUtil.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCDIR) src/HttpUtil.cpp
Socket.o: ./src/Socket.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCDIR) src/Socket.cpp
StringUtil.o: src/StringUtil.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCDIR) src/StringUtil.cpp
Url.o: src/Url.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCDIR) src/Url.cpp
TimeBasedDatabase.o: src/TimeBasedDatabase.cpp $(HEADERS)
	g++ -c $(CXXFLAG) $(INCDIR) src/TimeBasedDatabase.cpp
libutil.a: Makefile $(OBJECTS)
	ar -rs libutil.a $(OBJECTS)

clean:
	rm -f $(OBJECTS)
	rm -f libutil.a
	
